import http from '@/utils/request'

function cartListReg(userid) {
  return http({
    url: '/api/v1/shop_carts',
    method: 'get',
    params: { userid }, // 确保这里直接传递 userid
  })
}

function cartAddReg(product, amount, price,token) {
  return http({
    url: '/api/v1/shop_carts',
    method: 'post',
    params: { product, amount, price,token }, 
    headers:{token: localStorage.getItem('token')}

  })
}

export { cartListReg, cartAddReg }
